home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Pane2 / c / FindMain < prev    next >
Text File  |  1995-08-23  |  1KB  |  49 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for 
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #                                      
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Pane2.FindMain.c
  12.     Author:  Copyright © 1995 Andrew Sellors.
  13.     Version: 1.04 (4th August 1995)
  14.     Purpose: Handles windows with panes.
  15. */
  16.  
  17. #include "DeskLib:Pane2.h"
  18. #include "Pane2Defs.h"
  19. #include "Desklib:Event.h"
  20. #include "DeskLib:Template.h"
  21. #include "Desklib:EventMsg.h"
  22. #include "Desklib:Error.h"
  23.  
  24. #include <stdlib.h>
  25.  
  26.  
  27. /******************************************************************************/
  28.  
  29. extern main_listelement *FindMainWindow(window_handle window)
  30. {
  31.  /*
  32.   * searches through list of main window elements and returns pointer to
  33.   * element for 'window'
  34.   */
  35.   main_listelement *currentelement;
  36.  
  37.   currentelement = LinkList_FirstItem(&main_anchor);
  38.  
  39.   while(currentelement != NULL){
  40.  
  41.      if(currentelement->mainwindow == window)
  42.         break;
  43.  
  44.      currentelement = LinkList_NextItem(&(currentelement->header));
  45.   }
  46.  
  47.   return(currentelement);
  48. }
  49.